package com.lysj.bhp.borrowing.controller;

import com.lysj.bhp.borrowing.base.BorrowingContent;
import com.lysj.bhp.borrowing.domain.PostAccount;
import com.lysj.bhp.util.web.ParamUtil;
import com.lysj.bhp.util.web.Resp;
import org.springframework.data.domain.Sort;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author: ZhangWenJian
 * @Create: 2018/8/14--16:02
 * @Description:入账账户控制类
 */
@RestController
@RequestMapping("admin/post_account")
public class PostAccountController extends BorrowingContent {
    @RequestMapping("/list")
    public Resp list(PostAccount model){
        Specification specification = ParamUtil.createSpecification(model);
        List<PostAccount> postAccounts = postAccountRepository.findAll(specification);
        return new Resp(postAccounts);
    }
}
